home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / filesyst / ncpfs / mars_dos.000 / mars_dos / netpc / nwdebug.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-21  |  1.2 KB  |  40 lines

  1. /* nwdebug.c 21-May-96 */
  2.  
  3. /****************************************************************
  4.  * (C)opyright (C) 1993,1996  Martin Stover, Marburg, Germany   *
  5.  ****************************************************************/
  6.  
  7. #include "net.h"
  8.  
  9. static int usage(void)
  10. {
  11.   fprintf(stderr, "usage:\t%s NCPSERV|NWCONN|NWBIND level\n", funcname);
  12.   fprintf(stderr, "\tlevel=0 .. 99\n" );
  13.   return(-1);
  14. }
  15.  
  16. int func_debug(int argc, char *argv[], int mode)
  17. {
  18.   uint8 s[200];
  19.   int   module;
  20.   int   level;
  21.   int   result;
  22.   if (argc < 3) return(usage());
  23.   strmaxcpy(s, argv[1], sizeof(s) -1);
  24.   upstr(s);
  25.   if (!strcmp(s,      "NCPSERV")) module=NCPSERV;
  26.   else if (!strcmp(s, "NWCONN" )) module=NWCONN;
  27.   else if (!strcmp(s, "NWBIND" )) module=NWBIND;
  28.   else return(usage());
  29.   level = atoi(argv[2]);
  30.   if (level < 0 || level > 99) return(usage());
  31.   result = ncp_17_02(module, level);
  32.   if (result < 0) {
  33.     fprintf(stderr, "set debug failed\n");
  34.     fprintf(stderr, "perhaps you did not enable FUNC_17_02_IS_DEBUG\n");
  35.     fprintf(stderr, "in mars_nwe/config.h ?!");
  36.   } else fprintf(stdout, "Debug level for %s changed from %d to %d\n",
  37.              s, result, level);
  38.   return(result < 0 ? result : 0);
  39. }
  40.